import Router from "koa-router";
import roleModel from "../../../models/system/roleModel.js";
import userModel from "../../../models/system/userModel.js";

const router = Router();

router.post('/oneToMany', async (ctx, next) => {

  let res = await roleModel.findAll({
    include: [{
      model: userModel,
      attributes: ['id', 'username'],
    }],
    where: {
      id: 1
    }
  })
  ctx.body = res;
})
export default router;